$(function () {
    // 1 登录首页
    $('#btnDL').on('click', function () {
        let phone = $('#phone').val()
        let passWord = $('#password').val()
        $.ajax({
            url: 'http://124.223.14.236:8060/home/index/login',
            method: 'post',
            data: {
                mobile: phone,
                password: passWord
            },
            success: function (res) {
                if (res.errno !== 0) {
                    return alert(res.errmsg)
                }
                localStorage.setItem('token', res.data.token)
                location.href = '/user.html'
            }
        })
    })
})